<template>
  <q-page class="down-page q-pa-md">
    <div class="flex items-center q-mt-sm">
      <div
        class="center q-mr-sm"
        style="border-radius: 14px; border: 1px solid #fff; overflow: hidden"
      >
        <img src="~/assets/images/public/logo.png" style="width: 48px" />
      </div>
      <div>
        <div class="flex items-center">
          <div class="center">
            <img src="~/assets/images/public/logo_text.png" style="height: 15px" />
          </div>
          <div
            class="q-mx-xs"
            style="background-color: #9f896d; width: 1.5px; height: 14px; opacity: 0.24"
          ></div>
          <div style="color: #4c3c30; font-size: 13px">正规持牌消费金融机构</div>
        </div>

        <div class="flex q-mt-xs">
          <div
            style="
              background: #fe6c09;
              border-radius: 0px 6px 6px 6px;
              padding: 3px 6px;
              color: #fff;
              font-size: 12px;
            "
          >
            年华利率7.2%-24% (单利）
          </div>
        </div>
      </div>
    </div>

    <div class="" style="margin-top: 40px">
      <div
        class="bg-white q-mx-auto relative-position center"
        style="width: 80px; height: 80px; border-radius: 999999px; z-index: 2"
      >
        <img src="~/assets/images/down/icon.png" style="width: 54px" />
      </div>
      <div
        class="bg-white relative-position text-center"
        style="
          mint-height: 300px;
          border-radius: 12px;
          margin-top: -40px;
          z-index: 1;
          padding-top: 40px;
          padding-bottom: 8px;
        "
      >
        <div class="text-weight-bold" style="font-size: 16px">预审成功!</div>

        <div class="q-mt-md">
          <span>恭喜您获得资方审批</span
          ><span
            class="q-px-xs"
            style="color: #ffad13; font-size: 32px; font-family: DIN-Medium, DIN"
            >186,000</span
          ><span>额度</span>
        </div>

        <div class="flex items-center justify-center q-mt-lg">
          <q-icon name="south" size="xs" style="color: #ffb400" />
          <div style="color: #666666">令日激活额度享极速下款特权</div>
          <q-icon name="south" size="xs" style="color: #ffb400" />
        </div>

        <div class="center q-mt-lg">
          <img src="~/assets/images/down/img1.jpg" class="q-mx-auto" style="height: 60px" />
        </div>

        <q-btn
          unelevated
          rounded
          padding="none none"
          @click="downHandler"
          class="down-btn q-mx-auto q-mx-auto q-mt-lg"
          style=""
        >
          下载App 提现额度

          <div class="pointer">
            <img src="~/assets/images/public/pointer.png" style="display: block; width: 45px" />
          </div>
        </q-btn>

        <div class="center q-mt-lg">
          <img src="~/assets/images/down/text2.png" class="q-mx-auto" style="width: 80%" />
        </div>

        <div
          class="flex justify-around q-ma-md no-wrap"
          style="background-color: #fef8ee; border-radius: 8px; padding: 12px 10px"
        >
          <div>
            <div class="center">
              <img src="~/assets/images/public/icon1.png" style="width: 30px" />
            </div>
            <div style="font-size: 12px; transform: scale(0.9); white-space: nowrap; " class="q-mt-xs text-weight-bold">身份认证</div>
            <div
              style="font-size: 12px; color: #666; transform: scale(0.85); white-space: nowrap; "
              class="line-height-1"
            >
              需身份证/手机号
            </div>
          </div>
          <div class="line center" style="height: 30px; width: 36px;transform:translateX(-10px);">
            <div
              class="text-center"
              style="color: #ffad13; font-size: 12px; white-space: nowrap; transform: scale(0.8) translateX(-6px);"
            >
              最快一分钟
            </div>
            <img src="~/assets/images/public/line.png" style="width: 48px" />
          </div>
          <div style="margin-left: -15px;">
            <div class="center">
              <img src="~/assets/images/public/icon2.png" style="width: 30px" />
            </div>
            <div style="font-size: 12px;transform: scale(0.9); white-space: nowrap; " class="q-mt-xs text-weight-bold">官方审核</div>
            <div
              style="font-size: 12px; color: #666; transform: scale(0.85); white-space: nowrap"
              class="line-height-1"
            >
              智能加密审核
            </div>
          </div>
          <div class="line center " style="height: 30px; width: 40px;transform:translateX(-4px);">
            <div
              class="text-center"
              style="color: #ffad13; font-size: 12px; white-space: nowrap;   transform: scale(0.85) translateX(-0px);"
            >
            最快10秒
            </div>
            <img src="~/assets/images/public/line.png" style="width: 40px" />
          </div>
          <div style="margin-left: -20px;">
            <div class="center">
              <img src="~/assets/images/public/icon3.png" style="width: 30px" />
            </div>
            <div style="font-size: 12px;transform: scale(0.9); white-space: nowrap;" class="q-mt-xs text-weight-bold">获得额度</div>
            <div
              style="font-size: 12px; color: #666; transform: scale(0.85); white-space: nowrap"
              class="line-height-1"
            >
              24小时随时提现
            </div>
          </div>
        </div>
      </div>
    </div>
    <div class="" style="height: 50px"></div>
    <a href="app.apk" ref="downARef" download style="display: none;"></a>
  </q-page>
</template>

<script setup lang="ts">
import { isIOS } from 'mobile-device-detect';
import { iosLink } from 'src/config/env.config';
import { ref } from 'vue';

const downARef = ref<HTMLLinkElement>()
const downHandler = () => {
  if (isIOS) {
    window.open(iosLink)
  } else {
    downARef.value?.click()
  }
}

</script>

<style lang="scss" scoped>
.down-page {
  background-color: #fef8ee;
  background-image: url(src/assets/images/down/bg.png);
  background-repeat: no-repeat;
  background-size: 100% auto;
}
.down-btn {
  background: linear-gradient(130deg, #ffd668 0%, #ffad13 100%);
  cursor: pointer;
  border-radius: 99999px;
  width: 80%;
  font-weight: bold;
  font-size: 15px;
  min-height: 40px;
  padding: 12px !important;
  position: relative;
  .pointer {
    position: absolute;
    right: calc(15% - 22px);
    top: 42%;
  }
}
</style>
